#include "ServerConfig.h"
#include <windows.h>
#include <stdio.h>

ServerConfig::ServerConfig()
:m_port(0)
{
	memset(m_ip,0,sizeof(m_ip));
}

ServerConfig* ServerConfig::getPtr()
{
	static ServerConfig _this;
	return &_this;
}

bool ServerConfig::loadServerConfig(wchar_t* fileName)
{
	::GetPrivateProfileString(L"ServerConfig",L"IP",NULL,m_ip,sizeof(m_ip),fileName);
	m_port = static_cast<unsigned short>(::GetPrivateProfileInt(L"ServerConfig",L"PORT",0,fileName));
	return true;
}